package grpc

import (
	"fmt"
	"log"
	"net"

	"qmp_go_push/conf"

	"google.golang.org/grpc"
)

func InitServer() {
	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", conf.CONFIG.Server.RpcPort))
	if err != nil {
		log.Fatal("Fatal error net.Listen(tcp string, RpcPort int): \n", err.Error())
	}
	s := grpc.NewServer()

	//proto.RegisterImServiceServer(grpcServer, &rpc.Service{})

	if err := s.Serve(lis); err != nil {
		log.Fatal("Fatal error s.Serve(lis): \n", err.Error())
	}
}
